const mysql = require('mysql')
//1.连接
//createConnection(哪台服务器，用户名，密码)
let db = mysql.createConnection({
	host:'localhost',
	user: 'root',
	password:'root',
	database: '20190123'})
//2.查询
//query(干啥？，回调函数)
db.query('SELECT * FROM user_table',(err,data) => {
	if(err){
		console.log('出错')
	}else{
		
		console.log(JSON.stringify(data))
	}
})